import request from "../api/request"

export default {
    async runLogin({
        commit
    }, {
        user_name,
        password,
        routerT
    }) {
        console.log({
            user_name,
            password
        })
        commit("login", {
            user_name,
            password
        })
        let result = await request("post", `/login`, {
            user_name,
            password
        }, "form")
        const token = result.data.token
        commit("login", {
            user_name,
            token,
            password,
        })
        console.log(11111)
        console.log(routerT)
        console.log(result.data.info)
        if (result.data.info == "登录成功！！") {
            console.log(222222222222222222)
            routerT.push("/")
        }
    }
}